Skip to content

Conversation

smnandre
Copy link
Member

Q A
Bug fix? yes
New feature? no
Issues Fix #2388
License MIT

This method is called from multiple places, sometimes before children component are instanciated and stored in the component map.

So let's back to the quickest selector we have: the browser DOM selector :)

We'll know tomorrow, but it could solve #2388

This method is called at multiple place, sometimes before all children are already instanciated and stored in the component map.

So let's back to the quickest selector we have:  the browser DOM selector :)
@carsonbot carsonbot added Bug Bug Fix LiveComponent Status: Needs Review Needs to be reviewed labels Nov 20, 2024
Copy link
Contributor

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
LiveComponent
live_controller.js 120.36 kB / 23.38 kB 120.15 kB0% / 23.38 kB0%

@smnandre smnandre requested review from kbond and Kocal November 21, 2024 00:09
@Pechynho
Copy link

I can confirm that this change fixes the issue I reported in #2388. It might be helpful to add a comment about the potential race condition that could occur, so other developers are aware of it when building new plugins. For now, however, this solution seems sufficient to me.

In the future, it might be necessary to address this issue more specifically and deal with the timing problem, but for now, I would say this solution is acceptable.

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 23, 2024
@smnandre
Copy link
Member Author

Thank you @Pechynho for your time and for showing me where the bug was happening, how it was happening, and for having again time to check if the solution did work.

You cannot imagine how it eases this kind of situation and how it makes a bug almost.. enjoyable :)

I 100% note your comment about the whole "optimistic timing" issue and we will keep it in mind for the incoming changes.

@smnandre smnandre merged commit 3ea19c1 into symfony:2.x Nov 24, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LiveComponent] Race Condition in Live Components - Premature 'render:finished' Event Before Component Registration
4 participants